package com.ctyun.xstore.vod.snapshot;

import java.io.IOException;

import com.ctyun.xstore.vod.common.AbstractGeneralClient;
import com.ctyun.xstore.vod.snapshot.request.CreateSnapshotTaskRequest;
import com.ctyun.xstore.vod.snapshot.request.ListSnapshotTaskRequest;
import com.ctyun.xstore.vod.snapshot.request.SetVideoCoverRequest;
import com.ctyun.xstore.vod.snapshot.response.CreateSnapshotTaskResponse;
import com.ctyun.xstore.vod.snapshot.response.ListSnapshotTaskResponse;
import com.ctyun.xstore.vod.snapshot.response.SetVideoCoverResponse;

public class SnapshotClient extends AbstractGeneralClient {

	public SnapshotClient(String accessKey, String secretKey) {
		super(accessKey, secretKey);
	}

	public SnapshotClient(String host, String accessKey, String secretKey) {
		super(host, accessKey, secretKey);
	}

	/**
	 * 使用截图模板发起截图任务
	 * 
	 * @param request
	 * @return
	 * @throws IOException
	 */
	public CreateSnapshotTaskResponse createSnapshotTask(CreateSnapshotTaskRequest request) throws IOException {
		return this.execute(request, CreateSnapshotTaskResponse.class);
	}

	/**
	 * 获取截图任务列表
	 * 
	 * @param request
	 * @return
	 * @throws IOException
	 */
	public ListSnapshotTaskResponse listSnapshotTaskData(ListSnapshotTaskRequest request) throws IOException {
		return this.execute(request, ListSnapshotTaskResponse.class);
	}

	/**
	 * 使用指定封面设置为源视频封面
	 * 
	 * @param request
	 * @return
	 * @throws IOException
	 */
	public SetVideoCoverResponse setOriginalVideoCover(SetVideoCoverRequest request) throws IOException {
		return this.execute(request, SetVideoCoverResponse.class);
	}
}
